<?php

class AppController extends Controller
{
	var $components = array('Acl', 'Auth', 'Session');
	var $helpers = array('Html', 'Form', 'Session');
    
	
	function beforeFilter() {
		//Configure AuthComponent
		Security::setHash('md5');
		$this->Auth->authenticate = ClassRegistry::init('Persona');
		$this->Auth->userModel = 'Persona';
		$this->Auth->fields = array(
			'username' => 'usuario',
			'password' => 'clave'
		);
		$this->Auth->authorize = 'crud';
		$this->Auth->autoRedirect = true;
		$this->Auth->allowedActions = array('display');
		$this->Auth->loginAction = array('controller' => 'Personas', 'action' => 'login');
		$this->Auth->logoutRedirect = array('controller' => '/');
		$this->Auth->loginError = "Lo siento, la combinación usuario/clave es incorrecta.";
		$this->Auth->authError = "Lo siento, no tiene permisos para acceder a este proceso o su sesión se ha terminado";

		
	}
	
}
?>